Two Buttons
fun TwoButtons(positiveAction: () -> Unit, positiveText: String, negativeAction: () -> Unit?, negativeText: String = stringResource(R.string.btn_back), showNegative: Boolean = true, disablePositive: Boolean = false)
Deprecated
Use M3X instead of the com.porg.m3 package. Warning: the new version behaves like the Material 3 bottom app bar.
Replace with
import tech.cataspect.m3x.TwoButtons
Content copied to clipboard
tech.cataspect.m3x.TwoButtons(positiveAction, positiveText, negativeAction, negativeText, showNegative, disablePositive)
Content copied to clipboard
A negative (outlined, on the left) and positive (filled, on the right) button. Useful in setup wizards.
Parameters
positive Action
called when the positive button is pressed.
positive Text
the text for the positive button.
negative Action
called when the negative button is pressed. Can be null, in which case the negative button isn't shown.
negative Text
the text for the negative button. Defaults to "Back".
show Negative
if false hides the negative button. Defaults to true.
disable Positive
if true disables the positive button. Defaults to false.